package com.service;

import java.util.List;

import com.dao.TAdminDAO;
import com.dao.TCatelogDAO;

public class catelogService
{
    private TCatelogDAO catelogDAO;
    private TAdminDAO adminDAO;
    
    public TAdminDAO getAdminDAO() {
		return adminDAO;
	}
	public void setAdminDAO(TAdminDAO adminDAO) {
		this.adminDAO = adminDAO;
	}
	public List findAllCatelog()
    {
    	try
		{
			Thread.sleep(500);
		} catch (InterruptedException e)
		{
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
    	
    	String sql="from TCatelog where catelogDel='no' and catelogMiaoshu='1'";
		List cateLogList=catelogDAO.getHibernateTemplate().find(sql);
		return cateLogList;
    }
	public List findAllCatelog2()
    {
    	try
		{
			Thread.sleep(500);
		} catch (InterruptedException e)
		{
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
    	
    	String sql="from TCatelog where catelogDel='no' and catelogMiaoshu='2'";
		List cateLogList=catelogDAO.getHibernateTemplate().find(sql);
		return cateLogList;
    }
	public List findAllCatelog3()
    {
    	try
		{
			Thread.sleep(500);
		} catch (InterruptedException e)
		{
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
    	
    	String sql="from TCatelog where catelogDel='no' and catelogMiaoshu='3'";
		List cateLogList=catelogDAO.getHibernateTemplate().find(sql);
		return cateLogList;
    }
    public List findAllCatelog1()
    {
    	try
		{
			Thread.sleep(500);
		} catch (InterruptedException e)
		{
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
    	
    	String sql=" from TAdmin where id!=1";
		List cateLogList=adminDAO.getHibernateTemplate().find(sql);
		System.out.println(cateLogList.size());
		return cateLogList;
    }

	public TCatelogDAO getCatelogDAO()
	{
		return catelogDAO;
	}

	public void setCatelogDAO(TCatelogDAO catelogDAO)
	{
		this.catelogDAO = catelogDAO;
	}
    
}
